// AFTER-WARNING: Variable 'foo' is never used

class Test {
    fun bar() = 1

    fun test(x: Int) {
        val foo: () -> Int = if (x == 1)
            this::bar
        else
            <caret>this::bar
    }
}